home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
clang
/
jcool01.zip
/
EX3_10.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-08-20
|
1KB
|
33 lines
//
// Copyright (C) 1991 Texas Instruments Incorporated.
//
// Permission is granted to any individual or institution to use, copy, modify,
// and distribute this software, provided that this complete copyright and
// permission notice is maintained, intact, in all copies and supporting
// documentation.
//
// Texas Instruments Incorporated provides this software "as is" without
// express or implied warranty.
//
#include <cool/Bignum.h> // Include Bignum class
int main (void) {
CoolBignum b1; // Create CoolBignum object
CoolBignum b2 = "0xFFFFFFFF"; // Create CoolBignum object
CoolBignum b3 = "12345e30"; // Create CoolBignum object
cout << "b2 = " << b2 << "\n"; // Display value of b2
cout << "b3 = " << b3 << "\n"; // Display value of b3
b1 = b2 + b3; // Add b2 and b3
cout << "b2 + b3 = " << b1 << "\n"; // Display result
b1 = b2 - b3; // Subtract b3 from b2
cout << "b2 - b3 = " << b1 << "\n"; // Display result
b1 = b2 * b3; // Multiply b2 and b3
cout << "b2 * b3 = " << b1 << "\n"; // Display result
b1 = b3 / b2; // Divide b2 into b3
cout << "b3 / b2 = " << b1 << "\n"; // Display result
b1 = b3 % b2; // Get b3 modulo b2
cout << "b3 % b2 = " << b1 << "\n"; // Display result
return 0; // Exit with status code
}